package com.xueyi.aixihu.reqeust;

import com.xueyi.aixihu.exception.SzException;
import com.xueyi.aixihu.status.SystemCode;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @authoer:hxs
 * @createDate:2022/8/17
 * @description: 通过父级菜单id查询子级菜单查询条件
 */
@Data
public class FindClassifyReq {
    /**
     * 父级菜单id
     */
    @NotBlank(message = "请选择一级菜单")
    private String pidStr;
    private Integer pid;


    public void format() throws SzException {
        try {
            this.pid = Integer.parseInt(this.pidStr.trim());
        } catch (Exception e) {
            throw new SzException(SystemCode.QUERY_CHECK_ERROR, "参数类型错误");
        }
    }
}
